import request from '@/router/axios';

export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/listV2',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}

export const getDetail = (storeNo) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/detailV2',
    method: 'get',
    params: {
      storeNo
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/submitV3',
    // url: '/api/rb-merchant/merchant/posStore/pos_store/submitV2',
    method: 'post',
    data: row
  })
}

/**
 * 输入手机号判断是否输入密码
 */
 export const isStaffPassWord = (mobile) => {
	return request({
		url: '/api/rb-merchant/merchant/posStaff/pos_staff/isStaffPassWord',
		method: 'get',
		params: {
			mobile
		}
	})
}

export const update = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/submitV2',
    method: 'post',
    data: row
  })
}

export const getUpdatePwd = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/updatePassV2',
    method: 'post',
    data: row
  })
}

export const updateRpi = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/submitV2',
    method: 'post',
    data: row
  })
}



/* 商户门店状态 控制 0开启1禁用 */
export const changeStoreStatus = (id, storeStatus) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/changeStoreStatus',
    method: 'post',
    params: {
      id,
      storeStatus
    }
  })
}

/* 商户门店——指定商户 新增/修改 门店 */
export const addRpi = (row) => {
  return request({
    url: '/api/rb-merchant/merchant/posStore/pos_store/submitV2',
    method: 'post',
    data: row
  })
}

export const savePermission = (userNo) => {
  return request({
    url: '/api/rb-merchant/merchant/merchantpermission/merchant_permission/save',
    method: 'get',
    params:{userNo}
  })
}

// 权限 按钮
export const list = () => {
  return request({
    url: '/api/rb-merchant/merchant/merchantpermission/merchant_permission/list',
    method: 'get'
  })
}
